//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.comprosoft.telnet.command;

import com.comprosoft.telnet.io.IOHandler;
import com.comprosoft.telnet.io.TextColor;
import com.comprosoft.telnet.server.TelnetServer;
import java.util.logging.Level;

public final class CommandErrorHandler extends Command {
    private String failed;

    public CommandErrorHandler(IOHandler io, String failed_command, TelnetServer telnetServer) {
        super(io, "Error Command Handler", telnetServer);
        this.failed = failed_command;
    }

    protected CommandResult handleCommand(String[] args) {
        String message = "Failed to instantiate the command '" + this.failed + "'";
        IOHandler io = super.getIOHandler();
        Command.getLogger().log(Level.WARNING, message);
        io.SetTextColor(TextColor.RED);
        io.WriteLine("Failed to instantiate the command '" + this.failed + "'");
        return CommandResult.COMMAND_OK;
    }
}
